﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Twodi.Aspect.Interfaces;
using Microsoft.Xna.Framework;
using Twodi.Interfaces;
using Microsoft.Xna.Framework.Graphics;
using Twodi.Aspect.Implemented;

namespace Twodi.Implemented
{
    public class Texted : AbstractTexted
    {
        public Texted(SpriteFont font, Game game)
            : base(game)
        {
            this.TextProperties = new TextAspect(font);

            this.TextProperties.FontChanged += (sender, e) =>
            {
                this.Size = this.TextProperties.Font.MeasureString(Text);
            };

            this.TextProperties.TextChanged += (sender, e) =>
            {
                this.Size = this.TextProperties.Font.MeasureString(Text);
            };
        }
    }
}
